Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development


Using the isICFRunning function

You can call the isICFRunning function in your code to determine if Progress Dynamics is running. This is especially useful if your application contains a mix of new and old code that must operate differently depending on whether Progress Dynamics is running. Remember that ICF is the generic name for the Progress Dynamics product.

For example, in the testlaunch.w file you built earlier in this chapter, you might want to leave out the buttons that run Progress Dynamics-dependent components if the framework itself is not running. You can do this by adding this code to your startup in the main block of testlaunch.w in this example:

DEFINE VARIABLE lDynamics AS LOGICAL    NO-UNDO. 
lDynamics = DYNAMIC-FUNCTION('isICFRunning') NO-ERROR. 
IF lDynamics NE TRUE THEN 
    ASSIGN buCustomer:HIDDEN = YES 
           buOrders:HIDDEN = YES 
           buNotepad:HIDDEN = YES. 

Note that it is important to invoke the function NO-ERROR, since if the Configuration File Manager is not running, then the icICFRunning function is not defined, resulting in a run-time error. You also must make sure that you code does not have any other Progress Dynamics dependencies if it must work properly both with and without the framework.

Admittedly, this is a fairly silly example, since the test window only has buttons for Progress Dynamics-dependent functions, but if you run testlaunch.w from a Progress session that does not start Progress Dynamics, you can confirm that the buttons do not appear, as shown:


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095